using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._3DAnalystTools._Raster._Reclass
{
    /// <summary>
    /// <para>Slice</para>
    /// <para>Slices or reclassifies the range of values of the input cells into zones of equal interval or equal area, or by natural breaks.</para>
    /// <para>将输入像元的值范围切片或重新分类为间隔相等或面积相等的区域，或按自然中断进行分切。</para>
    /// </summary>    
    [DisplayName("Slice")]
    public class Slice : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public Slice()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_raster">
        /// <para>Input raster</para>
        /// <para>The input raster to be reclassified.</para>
        /// <para>要重新分类的输入栅格。</para>
        /// </param>
        /// <param name="_out_raster">
        /// <para>Output raster</para>
        /// <para><xdoc>
        ///   <para>The output reclassified raster.</para>
        ///   <para>The output will always be of integer type.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出对栅格进行了重新分类。</para>
        ///   <para>输出将始终为整数类型。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_number_zones">
        /// <para>Number of output zones</para>
        /// <para><xdoc>
        ///   <para>The number of zones to reclassify the input raster into.</para>
        ///   <para>When the slice method is Equal area, the output raster will have the defined number of zones, with a similar number of cells in each.</para>
        ///   <para>When Equal interval is used, the output raster will have the defined number of zones, each containing equal value ranges on the output raster.</para>
        ///   <para>When Natural breaks is used, the output raster will have the defined number of zones, with the number of cells in each determined by the class breaks.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>要将输入栅格重分类为的区域数。</para>
        ///   <para>当切片方法为等面积时，输出栅格将具有定义的区域数，每个区域具有相似数量的像元。</para>
        ///   <para>使用相等间隔时，输出栅格将具有定义的区域数，每个区域在输出栅格上包含相等的值范围。</para>
        ///   <para>使用自然间隔时，输出栅格将具有定义的区域数，每个区域中的像元数由类中断决定。</para>
        /// </xdoc></para>
        /// </param>
        public Slice(object _in_raster, object _out_raster, long? _number_zones)
        {
            this._in_raster = _in_raster;
            this._out_raster = _out_raster;
            this._number_zones = _number_zones;
        }
        public override string ToolboxName => "3D Analyst Tools";

        public override string ToolName => "Slice";

        public override string CallName => "3d.Slice";

        public override List<string> AcceptEnvironments => ["autoCommit", "cellSize", "cellSizeProjectionMethod", "compression", "configKeyword", "extent", "geographicTransformations", "mask", "outputCoordinateSystem", "scratchWorkspace", "snapRaster", "tileSize", "workspace"];

        public override object[] ParameterInfo => [_in_raster, _out_raster, _number_zones, _slice_type.GetGPValue(), _base_output_zone];

        /// <summary>
        /// <para>Input raster</para>
        /// <para>The input raster to be reclassified.</para>
        /// <para>要重新分类的输入栅格。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_raster { get; set; }


        /// <summary>
        /// <para>Output raster</para>
        /// <para><xdoc>
        ///   <para>The output reclassified raster.</para>
        ///   <para>The output will always be of integer type.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出对栅格进行了重新分类。</para>
        ///   <para>输出将始终为整数类型。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_raster { get; set; }


        /// <summary>
        /// <para>Number of output zones</para>
        /// <para><xdoc>
        ///   <para>The number of zones to reclassify the input raster into.</para>
        ///   <para>When the slice method is Equal area, the output raster will have the defined number of zones, with a similar number of cells in each.</para>
        ///   <para>When Equal interval is used, the output raster will have the defined number of zones, each containing equal value ranges on the output raster.</para>
        ///   <para>When Natural breaks is used, the output raster will have the defined number of zones, with the number of cells in each determined by the class breaks.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>要将输入栅格重分类为的区域数。</para>
        ///   <para>当切片方法为等面积时，输出栅格将具有定义的区域数，每个区域具有相似数量的像元。</para>
        ///   <para>使用相等间隔时，输出栅格将具有定义的区域数，每个区域在输出栅格上包含相等的值范围。</para>
        ///   <para>使用自然间隔时，输出栅格将具有定义的区域数，每个区域中的像元数由类中断决定。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Number of output zones")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public long? _number_zones { get; set; }


        /// <summary>
        /// <para>Slice method</para>
        /// <para><xdoc>
        ///   <para>The manner in which to slice the values in the input raster.</para>
        ///   <bulletList>
        ///     <bullet_item>Equal interval—Determines the range of the input values and divides the range into the specified number of output zones. Each zone on the sliced output raster has the potential of having input cell values that have the same range from the extremes. This is the default.</bullet_item><para/>
        ///     <bullet_item>Equal area—Specifies that the input values will be divided into the specified number of output zones, with each zone having a similar number of cells. Each zone will represent a similar amount of area.</bullet_item><para/>
        ///     <bullet_item>Natural breaks—Specifies that the classes will be based on natural groupings inherent in the data. Break points are identified by choosing the class breaks that best group similar values and that maximize the differences between classes. The cell values are divided into classes whose boundaries are set when there are relatively big jumps in the data values.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>对输入栅格中的值进行切片的方式。</para>
        ///   <bulletList>
        ///     <bullet_item>相等间隔 （Equal interval） - 确定输入值的范围，并将该范围划分为指定数量的输出区域。切片输出栅格上的每个区域都可能具有与极值具有相同范围的输入像元值。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>相等面积 （Equal area） - 指定将输入值划分为指定数量的输出区域，每个区域具有相似数量的像元。每个区域将代表相似的面积。</bullet_item><para/>
        ///     <bullet_item>自然分组 - 指定类将基于数据中固有的自然分组。通过选择对相似值进行最佳分组并最大化类之间差异的类间隔来识别断点。单元格值被划分为多个类，当数据值出现相对较大的跳跃时，将设置这些类的边界。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Slice method")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _slice_type_value _slice_type { get; set; } = _slice_type_value._EQUAL_INTERVAL;

        public enum _slice_type_value
        {
            /// <summary>
            /// <para>Equal interval</para>
            /// <para>Equal interval—Determines the range of the input values and divides the range into the specified number of output zones. Each zone on the sliced output raster has the potential of having input cell values that have the same range from the extremes. This is the default.</para>
            /// <para>相等间隔 （Equal interval） - 确定输入值的范围，并将该范围划分为指定数量的输出区域。切片输出栅格上的每个区域都可能具有与极值具有相同范围的输入像元值。这是默认设置。</para>
            /// </summary>
            [Description("Equal interval")]
            [GPEnumValue("EQUAL_INTERVAL")]
            _EQUAL_INTERVAL,

            /// <summary>
            /// <para>Equal area</para>
            /// <para>Equal area—Specifies that the input values will be divided into the specified number of output zones, with each zone having a similar number of cells. Each zone will represent a similar amount of area.</para>
            /// <para>相等面积 （Equal area） - 指定将输入值划分为指定数量的输出区域，每个区域具有相似数量的像元。每个区域将代表相似的面积。</para>
            /// </summary>
            [Description("Equal area")]
            [GPEnumValue("EQUAL_AREA")]
            _EQUAL_AREA,

            /// <summary>
            /// <para>Natural breaks</para>
            /// <para>Natural breaks—Specifies that the classes will be based on natural groupings inherent in the data. Break points are identified by choosing the class breaks that best group similar values and that maximize the differences between classes. The cell values are divided into classes whose boundaries are set when there are relatively big jumps in the data values.</para>
            /// <para>自然分组 - 指定类将基于数据中固有的自然分组。通过选择对相似值进行最佳分组并最大化类之间差异的类间隔来识别断点。单元格值被划分为多个类，当数据值出现相对较大的跳跃时，将设置这些类的边界。</para>
            /// </summary>
            [Description("Natural breaks")]
            [GPEnumValue("NATURAL_BREAKS")]
            _NATURAL_BREAKS,

        }

        /// <summary>
        /// <para>Base zone for output</para>
        /// <para><xdoc>
        ///   <para>Defines the lowest zone value on the output raster dataset.</para>
        ///   <para>The default value is 1.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>定义输出栅格数据集上的最低区域值。</para>
        ///   <para>默认值为 1。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Base zone for output")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _base_output_zone { get; set; } = 1;


        public Slice SetEnv(int? autoCommit = null, object cellSize = null, object compression = null, object configKeyword = null, object extent = null, object geographicTransformations = null, object mask = null, object outputCoordinateSystem = null, object scratchWorkspace = null, object snapRaster = null, double[] tileSize = null, object workspace = null)
        {
            base.SetEnv(autoCommit: autoCommit, cellSize: cellSize, compression: compression, configKeyword: configKeyword, extent: extent, geographicTransformations: geographicTransformations, mask: mask, outputCoordinateSystem: outputCoordinateSystem, scratchWorkspace: scratchWorkspace, snapRaster: snapRaster, tileSize: tileSize, workspace: workspace);
            return this;
        }

    }

}